home *** CD-ROM | disk | FTP | other *** search
/ Champak 52 / Volume 52 - JOGO DISK .iso / Games / shopdrop.swf / scripts / __Packages / ScrollBuilding.as < prev    next >
Text File  |  2007-09-27  |  1KB  |  45 lines

  1. class ScrollBuilding extends MovieClip
  2. {
  3.    var nTypes = 4;
  4.    function ScrollBuilding()
  5.    {
  6.       super();
  7.       this.aTypes = [];
  8.       this.aTypes.push(this.getBuildingType());
  9.       this.aTypes.push(this.getBuildingType());
  10.       this.aTypes.push(this.getBuildingType());
  11.       this.aBuildings = [this.bld2,this.bld1,this.bld0];
  12.       this.showBuildings();
  13.    }
  14.    function jump()
  15.    {
  16.       this.aTypes.splice(0,1);
  17.       var _loc2_ = this.getBuildingType();
  18.       this.aTypes.push(_loc2_);
  19.       this.showBuildings();
  20.    }
  21.    function getBuildingType()
  22.    {
  23.       var _loc2_ = undefined;
  24.       if(this.aTypes.length > 0)
  25.       {
  26.          do
  27.          {
  28.             _loc2_ = Math.ceil(Math.random() * this.nTypes);
  29.          }
  30.          while(_loc2_ == this.aTypes[this.aTypes.length - 1]);
  31.          
  32.       }
  33.       return _loc2_;
  34.    }
  35.    function showBuildings()
  36.    {
  37.       var _loc2_ = 0;
  38.       while(_loc2_ < this.aBuildings.length)
  39.       {
  40.          this.aBuildings[_loc2_].gotoAndStop(this.aTypes[_loc2_]);
  41.          _loc2_ = _loc2_ + 1;
  42.       }
  43.    }
  44. }
  45.